import {ref} from "vue"

export function useTableChoice<T>() {

    /**
     * 选中的原始数据
     */
    const _raw = ref<any[]>([])

    /**
     * 选中的主键数据
     */
    const _primarys = ref<T[]>([])

    /**
     * 选中回调
     * @param primarys
     * @param data
     * @constructor
     */
    function TabelChoice(primarys: any[], data: any[]) {
        _raw.value = data
        _primarys.value = primarys
    }

    return {
        TabelChoice, _raw, _primarys
    }
}